package com.itboye.pondteam.utils;

import java.text.DecimalFormat;

/**
 * Created by Administrator on 2017/3/22.
 */

public class NumberUtils {
    /**
     * 时间选择控件格式化为两位数的样式
     *
     * @param num
     * @return
     */
    public static String parse2Number(String num) {
        String str = "";
        int innerNum = Integer.parseInt(num);
        if (innerNum < 10) {
            str = "0" + num;
        }
        return str;
    }

    public static String getAppointNumber(int num, int digit) {
        String STR_FORMAT = "";
        for (int i = 0; i < digit; i++) {
            STR_FORMAT += 0;
        }
        Integer intHao = Integer.parseInt(num + "");
        DecimalFormat df = new DecimalFormat(STR_FORMAT);
        return df.format(intHao);
    }
}
